package scanner.config.controller;

import java.io.FileWriter;
import java.io.IOException;

import com.opensymphony.xwork2.ActionSupport;

public class Config extends ActionSupport {

	private String Ids;
	private String[] arrayId;
	
	public String getIds() {
		return Ids;
	}

	public void setIds(String ids) {
		Ids = ids;
	}
	public String[] getArrayId() {
		return arrayId;
	}

	public void setArrayId(String[] arrayId) {
		this.arrayId = arrayId;
	}

	public String execute() throws Exception{
		
		arrayId = Ids.split(",");
		System.out.println(Ids);
		for(int i=0;i<arrayId.length;i++)
		{
			System.out.println(arrayId[i]);
		}
		try {
			FileWriter fileWriter;
			fileWriter = new FileWriter("D:\\config.txt",false);
			fileWriter.write(Ids);
			fileWriter.flush();
			fileWriter.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "success";
	}
}
